import java.util.*;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: mac
 * Date: 2022-09-17
 * Time: 16:05
 */
class Employee {
    public int id;
    public int importance;
    public List<Integer> subordinates;
};
public class Day1 {
    //1.删除重复数字并排序 - 标记 - 牛客
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        ArrayList<Integer> list = new ArrayList<>(n);
        for (int i = 0; i < n; i++) {
            list.add(0);
        }
        for (int i = 0; i < n; i++) {
            int ret = scanner.nextInt();
            list.set(ret, ret);
        }
        for (int i = 0; i < n; i++) {
            if (list.get(i) != 0){
                System.out.print(list.get(i) + " ");
            }
        }
    }

    //2.打印倒三角
    public static void main2(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNext()) {
            int n = scanner.nextInt();
            for (int i = 0; i < n; i++) {
                for (int j = 0; j < n - i -1; j++) {
                    System.out.print("  ");
                }
                for (int j = 0; j <= i; j++) {
                    System.out.print("* ");
                }
                System.out.println();
            }
        }
    }

    //3.公司问题 - 标记
    public int getImportance(List<Employee> employees, int id) {
        //根据id找到根节点
        Employee root = null;
        for(Employee e : employees) {
            if(e.id == id) {
                root = e;
                break;
            }
        }
        //累加它的子树和
        int ans = root.importance;
        for(int sub : root.subordinates) {
            ans += getImportance(employees, sub);
        }
        return ans;

    }

    //88.合并两个有序数组
    public void merge1(int[] nums1, int m, int[] nums2, int n) {
        for (int i = 0; i < n; i++) {
            nums1[m++] = nums2[i];
        }
        Arrays.sort(nums1);
    }
    public void merge2(int[] nums1, int m, int[] nums2, int n) {
        int p = m-- + n-- -1;
        while (m > 0 && n > 0){
            nums1[p--] = nums1[m] > nums2[n] ? nums1[m--] : nums2[n--];
        }
        while (n > 0){
            nums1[p--] = nums2[n--];
        }
    }

    //118.杨辉三角
    public List<List<Integer>> generate(int numRows) {
        List<List<Integer>> lists = new ArrayList<>();

        List<Integer> list1 = new ArrayList<>();
        list1.add(1);
        lists.add(list1);

        for (int i = 1; i < numRows; i++) {
            List<Integer> list = new ArrayList<>();
            list.add(1);
            for (int j = 1; j < i; j++) {
                List<Integer> prevRows = lists.get(i - 1);
                list.add(prevRows.get(j) + prevRows.get(j - 1));
            }
            list.add(1);
            lists.add(list);
        }
        return lists;
    }

    //1.两数之和 - 标记 - HashMap
    public int[] twoSum1(int[] nums, int target) {
        int[] answer = new int[2];
        for (int i = 0; i < nums.length; i++) {
            for (int j = i + 1; j < nums.length; j++) {
                if (nums[i] == target - nums[j]){
                    answer[0] = i;
                    answer[1] = j;
                    return answer;
                }
            }
        }
        return answer;
    }
    public int[] twoSum2(int[] nums, int target) {
        int[] answer = new int[2];
        List<Integer> list = new ArrayList<>();
        for (int i = 0; i < nums.length; i++) {
            if (list.contains(nums[i])){
                answer[0] = i;
                answer[1] = list.indexOf(nums[i]);
            }
            list.add(target - nums[i]);
        }
        return answer;
    }
    //标记
    public int[] twoSum3(int[] nums, int target) {
        int[] indexs = new int[2];

        HashMap<Integer,Integer> hash = new HashMap<Integer,Integer>();
        for(int i = 0; i < nums.length; i++){
            if(hash.containsKey(nums[i])){
                indexs[0] = i;
                indexs[1] = hash.get(nums[i]);
                return indexs;
            }
            hash.put(target-nums[i],i);
        }
        return indexs;
    }

    //26.删除数组中重复项 - 标记
    public int removeDuplicates1(int[] nums) {
        int size = nums.length;
        for (int i = 0; i < size - 1; i++) {
            if (nums[i] == nums[i + 1]){
                int j = i;
                while (j < size - 1 && nums[j] == nums[j + 1]){
                    j++;
                }
                int index = j - i;
                for (int k = j; k < size; k++) {
                    nums[k - index] = nums[k];
                }
                size -= index;
            }
        }
        return size;
    }
    public int removeDuplicates2(int[] nums) {
        if (nums == null || nums.length == 1){
            return nums.length;
        }
        int i = 0;
        int j = 1;
        while (j < nums.length){
            if (nums[i] == nums[j]) {
                j++;
            }else{
                i++;
                nums[i] = nums[j];
                j++;
            }
        }
        return i + 1;//返回其长度
    }

    //27.移除元素
    public int removeElement(int[] nums, int val) {
        if(nums == null || nums.length == 0){
            return nums.length;
        }
        Arrays.sort(nums);
        int i = 0;
        int j = 1;
        int k = 0;
        while (k < nums.length){
            if (nums[k] == val){
                i = k;
                break;
            }else{
                k++;
            }
        }
        if (k == nums.length){
            return nums.length;
        }
        j = i + 1;
        while (j < nums.length) {
            if (nums[i] == val && nums[i] == nums[j]){
                j++;
            }else{
                nums[i] = nums[j];
                i++;
                j++;
            }
        }
        return i;
    }

    //35.搜索插入位置
    public int searchInsert(int[] nums, int target) {
        int left = 0;
        int right = nums.length - 1;
        int mid = (right - left) / 2 + left;
        while (left <= right){
            if (nums[mid] > target){
                right = mid - 1;
            }else if (nums[mid] < target){
                left = mid + 1;
            }else{
                break;
            }
            mid = (right - left) / 2 + left;
        }
        return mid;

    }

    //66.加一 - 标记
    public int[] plusOne(int[] digits) {
        int i = digits.length - 1;
        while (i >= 0 && ++digits[i] == 10){
            digits[i] = 0;
            i--;
        }
        if (i < 0){
            digits = Arrays.copyOf(digits,digits.length + 1);
            digits[0] = 1;
        }
        return digits;
    }
}
